﻿<UserControl 
  x:Class="Infragistics.Composite.Wpf.Samples.SearchModule.SearchView"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:res="clr-namespace:Infragistics.Composite.Wpf.Samples.SearchModule.Properties"
  xmlns:inf="clr-namespace:Infragistics.Composite.Wpf.Samples.Infrastructure;assembly=Infragistics.Composite.Wpf.Samples.Infrastructure"
  xmlns:ncal="http://infragistics.com/ncal"

  ncal:XamDockManagerSettings.SplitPaneName="{x:Static inf:SplitPanes.RightSidePaneName}"
  ncal:XamDockManagerSettings.SplitPaneProxyStyle="{Binding Source={x:Static inf:SplitPanes.Styles}, Path=RightSidePane}"
  FocusManager.FocusedElement="{Binding ElementName=searchTextBox}"
  >
  <ncal:XamDockManagerSettings.ContentPaneProxyStyle>
    <Style TargetType="{x:Type ncal:ContentPaneProxy}">
      <Setter Property="Header" Value="{x:Static res:Strings.SearchView_ContentPane_Header}" />
      <Setter Property="AllowDocking" Value="False" />
      <Setter Property="AllowDockingFloating" Value="False" />
      <Setter Property="AllowPinning" Value="False" />
      <Setter Property="Image" Value="Search.png" />
    </Style>
  </ncal:XamDockManagerSettings.ContentPaneProxyStyle>
  
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <DockPanel Grid.Row="0" Margin="2,2,2,4">
      <Button 
        DockPanel.Dock="Right" 
        Click="OnSearchButtonClick"
        Content="Search" 
        IsDefault="True" 
        MinWidth="80" 
        TabIndex="1" 
        VerticalAlignment="Center" 
        />
      <TextBlock 
        DockPanel.Dock="Left" 
        Text="{x:Static res:Strings.SearchView_SearchTextBoxHeader}" 
        VerticalAlignment="Center" 
        />
      <TextBox
        x:Name="searchTextBox"
        Margin="4,0" 
        TabIndex="0" 
        Text="{Binding Path=SearchText, UpdateSourceTrigger=PropertyChanged}" 
        />
    </DockPanel>
    <Frame 
      Grid.Row="1" 
      Source="{Binding Path=SearchResultsUri, Mode=OneWay}" 
      Navigating="Frame_Navigating"
      NavigationFailed="Frame_NavigationFailed"  
      LoadCompleted="Frame_LoadCompleted" 
      TabIndex="2"
      />
    <TextBlock 
      x:FieldModifier="private"
      x:Name="loadingMessage"
      Grid.Row="1"
      FontSize="16"
      FontWeight="SemiBold"
      HorizontalAlignment="Center"
      IsHitTestVisible="False"
      Text="{x:Static res:Strings.SearchView_LoadingMessage}" 
      TextWrapping="Wrap"
      VerticalAlignment="Center"
      Visibility="Collapsed"
      />
  </Grid>
</UserControl>